<template>
	<view>
		<dd-search :isfixed="true" @getdata="getdata"></dd-search>

		<view class="container" id="datalist">
			<block v-for="(item, index) in datalist" :key="index">
				<view class="order-box">
					<view class="content" style="border-bottom:none">
						<view class="detailBox">
							<view class="detail">
								<text class="t1">{{item.bname}}</text>
							</view>
							<view class="detailRight">
								<view class="show"  :style="'background:#3d7af7'" @click="postdata(item.id,item.v_bid,1)">同意</view>
								<view class="show"  :style="'background:#FF5511'" @click="postdata(item.id,item.v_bid,-1)">拒绝</view>
							</view>
						</view>
					</view>
				</view>
			</block>
		</view>
		<nomore v-if="nomore"></nomore>
		<nodata v-if="nodata"></nodata>

		<popmsg ref="popmsg"></popmsg>
	</view>
</template>

<script>
	var app = getApp();

	export default {
		data() {
			return {
				st: 'all',
				datalist: [],
				page: 1,
				nomore: false,
				count0: 0,
				count1: 0,
				countall: 0,
				sclist: "",
				keyword: '',
				nodata: false,
			};
		},
		onLoad: function(opt) {
			this.opt = app.getopts(opt);
			this.getdata();
		},
		onPullDownRefresh: function() {
			this.getdata();
		},
		onReachBottom: function() {
			if (!this.nodata && !this.nomore) {
				this.page = this.page + 1;
				this.getdata(true);
			}
		},
		methods: {
			changetab: function(st) {
				var that = this;
				that.st = st;
				that.getdata();
			},
			getdata: function(loadmore, keyword) {
				if (!loadmore) {
					this.page = 1;
					this.datalist = [];
				}
				var that = this;
				var page = that.page;
				that.nodata = false;
				that.nomore = false;
				that.loading = true;
				app.post(
					// 'ApiAdminIndex/getvideolist'
					'ApiAllianceCard/seachMembers', {
						id:this.opt.id,
						page: page,
						limit: 10
					},
					function(res) {
						console.log(res, '===>res')
						that.loading = false;
						var data = res.data.data;
						if (page == 1) {
							that.datalist = data;
							if (data.length == 0) {
								that.nodata = true;
							}
							that.loaded();
						} else {
							if (data.length == 0) {
								that.nomore = true;
							} else {
								var datalist = that.datalist;
								var newdata = datalist.concat(data);
								that.datalist = newdata;
							}
						}
					});
			},
			postdata:function(id,bid,status){
				var that = this;
				app.post(
					// 'ApiAdminIndex/getvideolist'
					'ApiAllianceCard/examineMembers', {
						id:id,
						bid: bid,
						status:status
					},
					function(res) {
						console.log(res,'===>res')
						if(res.status == 0){
							app.error(res.msg)
						}else if(res.status == 1){
							app.success(res.msg)
						}
						that.getdata();
					});
			}
			
		}
	};
</script>
<style>
	.container {
		width: 100%;
		margin-top: 106rpx
	}

	.order-box {
		width: 94%;
		margin: 0 3%;
		padding: 5% 3%;
		background: #fff;
		margin-bottom: 12rpx;
		border-radius: 16rpx
	}

	.order-box .content {
		display: flex;
		width: 100%;
		padding: 16rpx 0px;
		border-bottom: 1px #e5e5e5 dashed;
		position: relative
	}

	.order-box .content:last-child {
		border-bottom: 0;
	}

	.order-box .content image {
		width: 140rpx;
		height: 140rpx;
	}

	.order-box .content .detail {
		display: flex;
		flex-direction: column;
		margin-left: 14rpx;
		flex: 1
	}

	.detail {
		justify-content: space-around;
	}

	.detailBox {
		margin-left: 10rpx;
		flex: 1;
		display: flex;
		justify-content: space-between;
	}

	.detailBox .detailRight {
		font-size: 28rpx;
		font-weight: 400;
		display: flex;
	}
	.detailBox .detailRight .show{
		color: #fff;
		padding: 5rpx 10rpx;
		border-radius: 5rpx;
		margin-left: 30rpx;
	}
	

	.order-box .content .detail .t1 {
		font-size: 34rpx;
		font-weight: bold;
		min-height: 50rpx;
		line-height: 36rpx;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}

	.order-box .content .detail .t2 {
		height: 36rpx;
		line-height: 36rpx;
		color: #999;
		overflow: hidden;
		font-size: 24rpx;
	}

	.order-box .content .detail .t3 {
		display: flex;
		height: 36rpx;
		line-height: 36rpx;
		color: #ff4246;
		font-size: 24rpx;
	}

	.order-box .content .detail .x1 {
		font-size: 30rpx;
		margin-right: 5px
	}

	.order-box .content .detail .x2 {
		font-size: 24rpx;
		text-decoration: line-through;
		color: #999
	}

	.order-box .bottom {
		width: 100%;
		padding: 10rpx 0px;
		border-top: 1px #e5e5e5 solid;
		color: #555;
	}

	.order-box .op {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 10rpx 0rpx;
		border-top: 1px #e5e5e5 solid;
		color: #555;
	}

	.btn2Box {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 10rpx 0rpx;
	}

	.btn1 {
		margin-left: 20rpx;
		width: 120rpx;
		height: 60rpx;
		line-height: 60rpx;
		color: #fff;
		border-radius: 3px;
		text-align: center
	}

	.btn2 {
		margin-left: 20rpx;
		/* width: 120rpx; */
		padding: 0 20rpx;
		height: 60rpx;
		line-height: 60rpx;
		color: #333;
		background: #fff;
		border: 1px solid #cdcdcd;
		border-radius: 3px;
		text-align: center
	}

	.btn-add {
		width: 90%;
		max-width: 700px;
		margin: 0 auto;
		height: 96rpx;
		line-height: 96rpx;
		text-align: center;
		color: #fff;
		font-size: 30rpx;
		font-weight: bold;
		border-radius: 40rpx;
		position: fixed;
		left: 0px;
		right: 0;
		bottom: 0;
		margin-bottom: 20rpx;
	}
</style>